package com.hlxt.nj.busi.model;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class TCourseCriteria {
    protected String orderByClause;

    protected boolean distinct;

    protected List<Criteria> oredCriteria;

    private Integer firstResult;

    private Integer maxResults;

    private Integer endResult;

    public TCourseCriteria() {
        oredCriteria = new ArrayList<Criteria>();
    }

    protected TCourseCriteria(TCourseCriteria example) {
        this.orderByClause = example.orderByClause;
        this.oredCriteria = example.oredCriteria;
        this.distinct = example.distinct;
    }

    public void setOrderByClause(String orderByClause) {
        this.orderByClause = orderByClause;
    }

    public String getOrderByClause() {
        return orderByClause;
    }

    public void setDistinct(boolean distinct) {
        this.distinct = distinct;
    }

    public boolean isDistinct() {
        return distinct;
    }

    public List<Criteria> getOredCriteria() {
        return oredCriteria;
    }

    public void or(Criteria criteria) {
        oredCriteria.add(criteria);
    }

    public Criteria or() {
        Criteria criteria = createCriteriaInternal();
        oredCriteria.add(criteria);
        return criteria;
    }

    public Criteria createCriteria() {
        Criteria criteria = createCriteriaInternal();
        if (oredCriteria.size() == 0) {
            oredCriteria.add(criteria);
        }
        return criteria;
    }

    protected Criteria createCriteriaInternal() {
        Criteria criteria = new Criteria();
        return criteria;
    }

    public void clear() {
        oredCriteria.clear();
        orderByClause = null;
        distinct = false;
    }

    public void setFirstResult(Integer firstResult) {
        this.firstResult = firstResult;
    }

    public Integer getFirstResult() {
        return firstResult;
    }

    public void setMaxResults(Integer maxResults) {
        this.maxResults = maxResults;
    }

    public Integer getMaxResults() {
        return maxResults;
    }

    public Integer getEndResult() {
        return firstResult + maxResults ;
    }

    protected abstract static class GeneratedCriteria {
        protected List<String> criteriaWithoutValue;

        protected List<Map<String, Object>> criteriaWithSingleValue;

        protected List<Map<String, Object>> criteriaWithListValue;

        protected List<Map<String, Object>> criteriaWithBetweenValue;

        protected GeneratedCriteria() {
            super();
            criteriaWithoutValue = new ArrayList<String>();
            criteriaWithSingleValue = new ArrayList<Map<String, Object>>();
            criteriaWithListValue = new ArrayList<Map<String, Object>>();
            criteriaWithBetweenValue = new ArrayList<Map<String, Object>>();
        }

        public boolean isValid() {
            return criteriaWithoutValue.size() > 0
                || criteriaWithSingleValue.size() > 0
                || criteriaWithListValue.size() > 0
                || criteriaWithBetweenValue.size() > 0;
        }

        public List<String> getCriteriaWithoutValue() {
            return criteriaWithoutValue;
        }

        public void setCriteriaWithoutValue(List<String> criteriaWithoutValue) {
            this.criteriaWithoutValue = criteriaWithoutValue;
        }

        public List<Map<String, Object>> getCriteriaWithSingleValue() {
            return criteriaWithSingleValue;
        }

        public void setCriteriaWithSingleValue(List<Map<String, Object>> criteriaWithSingleValue) {
            this.criteriaWithSingleValue = criteriaWithSingleValue;
        }

        public List<Map<String, Object>> getCriteriaWithListValue() {
            return criteriaWithListValue;
        }

        public void setCriteriaWithListValue(List<Map<String, Object>> criteriaWithListValue) {
            this.criteriaWithListValue = criteriaWithListValue;
        }

        public List<Map<String, Object>> getCriteriaWithBetweenValue() {
            return criteriaWithBetweenValue;
        }

        public void setCriteriaWithBetweenValue(List<Map<String, Object>> criteriaWithBetweenValue) {
            this.criteriaWithBetweenValue = criteriaWithBetweenValue;
        }

        protected void addCriterion(String condition) {
            if (condition == null) {
                throw new RuntimeException("Value for condition cannot be null");
            }
            criteriaWithoutValue.add(condition);
        }

        protected void addCriterion(String condition, Object value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            Map<String, Object> map = new HashMap<String, Object>();
            map.put("condition", condition);
            map.put("value", value);
            criteriaWithSingleValue.add(map);
        }

        protected void addCriterion(String condition, List<? extends Object> values, String property) {
            if (values == null || values.size() == 0) {
                throw new RuntimeException("Value list for " + property + " cannot be null or empty");
            }
            Map<String, Object> map = new HashMap<String, Object>();
            map.put("condition", condition);
            map.put("values", values);
            criteriaWithListValue.add(map);
        }

        protected void addCriterion(String condition, Object value1, Object value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            List<Object> list = new ArrayList<Object>();
            list.add(value1);
            list.add(value2);
            Map<String, Object> map = new HashMap<String, Object>();
            map.put("condition", condition);
            map.put("values", list);
            criteriaWithBetweenValue.add(map);
        }

        public Criteria andIdIsNull() {
            addCriterion("id is null");
            return (Criteria) this;
        }

        public Criteria andIdIsNotNull() {
            addCriterion("id is not null");
            return (Criteria) this;
        }

        public Criteria andIdEqualTo(String value) {
            addCriterion("id =", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotEqualTo(String value) {
            addCriterion("id <>", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdGreaterThan(String value) {
            addCriterion("id >", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdGreaterThanOrEqualTo(String value) {
            addCriterion("id >=", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdLessThan(String value) {
            addCriterion("id <", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdLessThanOrEqualTo(String value) {
            addCriterion("id <=", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdLike(String value) {
            addCriterion("id like", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotLike(String value) {
            addCriterion("id not like", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdIn(List<String> values) {
            addCriterion("id in", values, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotIn(List<String> values) {
            addCriterion("id not in", values, "id");
            return (Criteria) this;
        }

        public Criteria andIdBetween(String value1, String value2) {
            addCriterion("id between", value1, value2, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotBetween(String value1, String value2) {
            addCriterion("id not between", value1, value2, "id");
            return (Criteria) this;
        }

        public Criteria andCnameIsNull() {
            addCriterion("cname is null");
            return (Criteria) this;
        }

        public Criteria andCnameIsNotNull() {
            addCriterion("cname is not null");
            return (Criteria) this;
        }

        public Criteria andCnameEqualTo(String value) {
            addCriterion("cname =", value, "cname");
            return (Criteria) this;
        }

        public Criteria andCnameNotEqualTo(String value) {
            addCriterion("cname <>", value, "cname");
            return (Criteria) this;
        }

        public Criteria andCnameGreaterThan(String value) {
            addCriterion("cname >", value, "cname");
            return (Criteria) this;
        }

        public Criteria andCnameGreaterThanOrEqualTo(String value) {
            addCriterion("cname >=", value, "cname");
            return (Criteria) this;
        }

        public Criteria andCnameLessThan(String value) {
            addCriterion("cname <", value, "cname");
            return (Criteria) this;
        }

        public Criteria andCnameLessThanOrEqualTo(String value) {
            addCriterion("cname <=", value, "cname");
            return (Criteria) this;
        }

        public Criteria andCnameLike(String value) {
            addCriterion("cname like", value, "cname");
            return (Criteria) this;
        }

        public Criteria andCnameNotLike(String value) {
            addCriterion("cname not like", value, "cname");
            return (Criteria) this;
        }

        public Criteria andCnameIn(List<String> values) {
            addCriterion("cname in", values, "cname");
            return (Criteria) this;
        }

        public Criteria andCnameNotIn(List<String> values) {
            addCriterion("cname not in", values, "cname");
            return (Criteria) this;
        }

        public Criteria andCnameBetween(String value1, String value2) {
            addCriterion("cname between", value1, value2, "cname");
            return (Criteria) this;
        }

        public Criteria andCnameNotBetween(String value1, String value2) {
            addCriterion("cname not between", value1, value2, "cname");
            return (Criteria) this;
        }

        public Criteria andMaxpopIsNull() {
            addCriterion("maxpop is null");
            return (Criteria) this;
        }

        public Criteria andMaxpopIsNotNull() {
            addCriterion("maxpop is not null");
            return (Criteria) this;
        }

        public Criteria andMaxpopEqualTo(Integer value) {
            addCriterion("maxpop =", value, "maxpop");
            return (Criteria) this;
        }

        public Criteria andMaxpopNotEqualTo(Integer value) {
            addCriterion("maxpop <>", value, "maxpop");
            return (Criteria) this;
        }

        public Criteria andMaxpopGreaterThan(Integer value) {
            addCriterion("maxpop >", value, "maxpop");
            return (Criteria) this;
        }

        public Criteria andMaxpopGreaterThanOrEqualTo(Integer value) {
            addCriterion("maxpop >=", value, "maxpop");
            return (Criteria) this;
        }

        public Criteria andMaxpopLessThan(Integer value) {
            addCriterion("maxpop <", value, "maxpop");
            return (Criteria) this;
        }

        public Criteria andMaxpopLessThanOrEqualTo(Integer value) {
            addCriterion("maxpop <=", value, "maxpop");
            return (Criteria) this;
        }

        public Criteria andMaxpopIn(List<Integer> values) {
            addCriterion("maxpop in", values, "maxpop");
            return (Criteria) this;
        }

        public Criteria andMaxpopNotIn(List<Integer> values) {
            addCriterion("maxpop not in", values, "maxpop");
            return (Criteria) this;
        }

        public Criteria andMaxpopBetween(Integer value1, Integer value2) {
            addCriterion("maxpop between", value1, value2, "maxpop");
            return (Criteria) this;
        }

        public Criteria andMaxpopNotBetween(Integer value1, Integer value2) {
            addCriterion("maxpop not between", value1, value2, "maxpop");
            return (Criteria) this;
        }

        public Criteria andIsgradeIsNull() {
            addCriterion("isgrade is null");
            return (Criteria) this;
        }

        public Criteria andIsgradeIsNotNull() {
            addCriterion("isgrade is not null");
            return (Criteria) this;
        }

        public Criteria andIsgradeEqualTo(String value) {
            addCriterion("isgrade =", value, "isgrade");
            return (Criteria) this;
        }

        public Criteria andIsgradeNotEqualTo(String value) {
            addCriterion("isgrade <>", value, "isgrade");
            return (Criteria) this;
        }

        public Criteria andIsgradeGreaterThan(String value) {
            addCriterion("isgrade >", value, "isgrade");
            return (Criteria) this;
        }

        public Criteria andIsgradeGreaterThanOrEqualTo(String value) {
            addCriterion("isgrade >=", value, "isgrade");
            return (Criteria) this;
        }

        public Criteria andIsgradeLessThan(String value) {
            addCriterion("isgrade <", value, "isgrade");
            return (Criteria) this;
        }

        public Criteria andIsgradeLessThanOrEqualTo(String value) {
            addCriterion("isgrade <=", value, "isgrade");
            return (Criteria) this;
        }

        public Criteria andIsgradeLike(String value) {
            addCriterion("isgrade like", value, "isgrade");
            return (Criteria) this;
        }

        public Criteria andIsgradeNotLike(String value) {
            addCriterion("isgrade not like", value, "isgrade");
            return (Criteria) this;
        }

        public Criteria andIsgradeIn(List<String> values) {
            addCriterion("isgrade in", values, "isgrade");
            return (Criteria) this;
        }

        public Criteria andIsgradeNotIn(List<String> values) {
            addCriterion("isgrade not in", values, "isgrade");
            return (Criteria) this;
        }

        public Criteria andIsgradeBetween(String value1, String value2) {
            addCriterion("isgrade between", value1, value2, "isgrade");
            return (Criteria) this;
        }

        public Criteria andIsgradeNotBetween(String value1, String value2) {
            addCriterion("isgrade not between", value1, value2, "isgrade");
            return (Criteria) this;
        }

        public Criteria andCountIsNull() {
            addCriterion("count is null");
            return (Criteria) this;
        }

        public Criteria andCountIsNotNull() {
            addCriterion("count is not null");
            return (Criteria) this;
        }

        public Criteria andCountEqualTo(Integer value) {
            addCriterion("count =", value, "count");
            return (Criteria) this;
        }

        public Criteria andCountNotEqualTo(Integer value) {
            addCriterion("count <>", value, "count");
            return (Criteria) this;
        }

        public Criteria andCountGreaterThan(Integer value) {
            addCriterion("count >", value, "count");
            return (Criteria) this;
        }

        public Criteria andCountGreaterThanOrEqualTo(Integer value) {
            addCriterion("count >=", value, "count");
            return (Criteria) this;
        }

        public Criteria andCountLessThan(Integer value) {
            addCriterion("count <", value, "count");
            return (Criteria) this;
        }

        public Criteria andCountLessThanOrEqualTo(Integer value) {
            addCriterion("count <=", value, "count");
            return (Criteria) this;
        }

        public Criteria andCountIn(List<Integer> values) {
            addCriterion("count in", values, "count");
            return (Criteria) this;
        }

        public Criteria andCountNotIn(List<Integer> values) {
            addCriterion("count not in", values, "count");
            return (Criteria) this;
        }

        public Criteria andCountBetween(Integer value1, Integer value2) {
            addCriterion("count between", value1, value2, "count");
            return (Criteria) this;
        }

        public Criteria andCountNotBetween(Integer value1, Integer value2) {
            addCriterion("count not between", value1, value2, "count");
            return (Criteria) this;
        }
    }

    public static class Criteria extends GeneratedCriteria {

        protected Criteria() {
            super();
        }

        public Criteria andIdLikeInsensitive(String value) {
            addCriterion("upper(id) like", value.toUpperCase(), "id");
            return this;
        }

        public Criteria andCnameLikeInsensitive(String value) {
            addCriterion("upper(cname) like", value.toUpperCase(), "cname");
            return this;
        }

        public Criteria andIsgradeLikeInsensitive(String value) {
            addCriterion("upper(isgrade) like", value.toUpperCase(), "isgrade");
            return this;
        }
    }
}